<template>
<div>
  <a href="/coupon">更多</a>
  <el-table
      :data="tableData"
      style="width: 100%">
    <el-table-column
        prop="name"
        label="优惠券"
        width="180">
    </el-table-column>
    <el-table-column
        label="图片"
        width="180">
      <template slot-scope="scope">
        <img :src="scope.row.image" alt="" style="width: 100px; height: 100px;">
      </template>
    </el-table-column>
    <el-table-column
        prop="startDate"
        label="开始时间"
        width="180">
    </el-table-column>
    <el-table-column
        prop="endDate"
        label="结束时间"
        width="180">
    </el-table-column>
    <el-table-column
        label="状态">
      <template v-slot="scope">
        <font v-if="scope.row.status==0">可使用</font>
        <font v-if="scope.row.status==1">已过期</font>
      </template>
    </el-table-column>
    <el-table-column
        prop="createTime"
        label="发行时间"
        width="180">
    </el-table-column>

  </el-table>
</div>
</template>

<script>
export default {
  name: "NewListView",
  data(){
    return{
      tableData:[],
    }
  },methods:{
    list(){
      this.axios.post("coupon/newList").then(res=>{
        this.tableData=res.data.data;
    })
    }
  },created() {
    this.list();
  }
}
</script>

<style scoped>

</style>
